package com.example.controller;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract class ActionServlet {

	protected abstract String getURL();
	public abstract void process(ServletContext ctx,HttpServletRequest req,HttpServletResponse res) throws Exception;

	public void forward(HttpServletRequest req,HttpServletResponse res) throws IOException, ServletException
	{
		_dispatch(req,res);
	}
	protected void _dispatch(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		// TODO Auto-generated method stub
		RequestDispatcher rd = req.getRequestDispatcher(getURL());
		rd.forward(req, res);
	}
}
